/*
 * @Author: your name
 * @Date: 2021-07-28 17:33:27
 * @LastEditTime: 2021-07-29 10:37:28
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /shb-pc-fe/src/modules/productV2/productView/components/methods/fetch.js
 */
/* eslint-disable no-empty-function */
/* api */
import * as TaskApi from '@src/api/TaskApi.ts';

export default {
  /** 
   * @description 通过联系人获取地址数据
  */
  fetchLmBindAddress(params) {
    return TaskApi.getLmBindAddress(params);
  },
  /** 
   * @description 获取客户数据
  */
  fetchCustomerData () {
    return TaskApi.getCreateCustomerData()
      .then(res => {
        let isSuccess = res.status == 0;

        if(isSuccess) {
          this.customerInitData = res.data;
          this.customerFormView = this.renderCustomerForm(res.data);
        } else {
          this.$platform.alert(res.message);
        }

      })
      .catch(err => console.error('error', err));
  },
  /** 
   * @description 获取工单客户默认数据
  */
   fetchTaskDefaultInfo(params) {
    return TaskApi.getTaskDefaultInfo(params);
  },
    /** 
   * @description 关联显示项数据查询
  */
     fetchRelatedInfo(params) {
      return TaskApi.getRelatedInfos(params);
    },
}